<?php
class infoService extends commonService{
    private $table=null;
    public function __construct(){
        parent::__construct();
        $this->table=table('admin');
    }
    private function get_id(){
        return $_SESSION['MY']['ID'];
    }
    public function get_info(){
        $id=$this->get_id();
        $query="select `email`,`reg_time`,`times` from `{$this->table}` where `id`=:id limit 1";
        return $this->m->select($query,array('id'=>$id));
    }
    public function update_info($d){
        $id=$this->get_id();
        $query="update `{$this->table}` set `email`=:email where `id`=:id limit 1";
        return $this->m->query($query,array('email'=>$d['email'],'id'=>$id));
    }
}